package com.liao.cloudstorage.controller;

import com.liao.cloudstorage.conf.MinioClientBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author liao
 */
@Controller
public class MinioController {
    private static String  grafana_url = MinioClientBean.grafana_url;
    private static String  prometheus_url = MinioClientBean.prometheus_url;
    private static Logger logger = LoggerFactory.getLogger(MinioController.class);
    @GetMapping("/prometheus/")
    public String minioGuiController(ModelMap modelMap){
        modelMap.addAttribute("prometheus_url",prometheus_url);
        logger.debug(prometheus_url);
        return "prometheus";
    }
    @GetMapping("/grafana/")
    public String grafana(ModelMap modelMap){
        return "redirect:"+grafana_url;
    }
    @GetMapping("/apidocs/")
    public String apiDocs(){
        return "api-docs";
    }



}
